%a program to average STA's for a number of cells
global CONTROL
sel=getmainselection;
vm=[]
for i=1:length(sel)
   c=CONTOL(sel(i)).spike;
   if (i=1)
      vm=c.vavg;
   else
      vm=vm+c.vavg;
   end
end
figure
plot (c.tavg,vm)
      